import count from '@dfeidao/atom-nodejs/db/count';
// import operate from '@dfeidao/atom-nodejs/db/operate';
import log from '@dfeidao/atom-nodejs/logger/log';
// import { systemid } from '../../atom/config';
interface Message {
	productid: string;
	level_no: string;
}

export default async function atom(msg: Message, action_id: string, session_id: string) {
	log(`Service begin`);
	const { prepare, exec } = count(action_id, session_id, '12');
	prepare('pub_tenant', { productid: msg.productid, tenant_level: msg.level_no });
	const [cou] = await exec();
	if (cou === 0) {
		return "success";
	} else {
		return 'fali';
	}
}
